package part1;
/**
 * <p>Title: Lab #7 part 1</p>
 * <p>Description: CS 235 Lab #7 part 1
 *       Shows how to get started with using the Comparable interface.</p>
 * @author Anthony Varghese
 * @date   September 5th 2014
 * @version 1.0
 */

class Data {
	private int data;
	public Data(int d){
		data = d;
	}
	public String toString(){
		return "[" + data + "]";
	}
}

public class Part1 {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String s1 = "10";
		String s2 = "20";
		System.out.print(" s1 is " + s1 + " and s2 is " + s2 + " and therefore ");
		final int diff = s1.compareTo( s2 ); 
		if ( diff > 0 )
			 System.out.println(" s1 > s2 ");
		else if ( diff < 0 )
			 System.out.println(" s1 < s2 ");
		else System.out.println(" s1 == s2 ");
		System.out.println("-------------------------------------------");
		
		Data d1 = new Data( 20 );
		Data d2 = new Data( 10 );
		System.out.print(" d1 is " + d1 + " and d2 is " + d2 + " and therefore ");
//		diff = d1.compareTo( d2 );
		if ( diff > 0)
			 System.out.println(" d1 > d2 ");
		else if ( diff < 0 )
			 System.out.println(" d1 < d2 ");
		else System.out.println(" d1 == d2 ");
	}
}
